﻿using System;
using System.Collections.Generic;
 
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class sms :MpageBase
{
    protected Model.CMember cmember = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (loginUserInfo != null && loginUserInfo.Id > 0)
            {
                if (loginUserInfo.zhuihaoMsg)
                {
                    zhuihaocheck.Checked = true;
                }
                if (loginUserInfo.gendanMsg)
                {
                    gendancheck.Checked = true;
                }
            }
        }
    }
    protected void submitBtn_Click(object sender, EventArgs e)
    {
        if (loginUserInfo != null && loginUserInfo.Id > 0)
        { 
            cmember = BLL.CMember.GetModel(loginUserInfo.Id);
            if (cmember!=null)
            {
                if (zhuihaocheck.Checked)
                {
                    cmember.zhuihaoMsg = true;
                }
                else
                {
                    cmember.zhuihaoMsg = false;
                }
                if (gendancheck.Checked)
                {
                    cmember.gendanMsg = true;
                }
                else
                {
                    cmember.gendanMsg = false;
                }
                System.Web.HttpContext.Current.Session[BLL.CMember.LoginUserSessionKey] = cmember;
                if (BLL.CMember.Update(cmember) > 0)
                {
                    alertmessageAndGoback("成功！");
                }
            }
            else
            {
                alertmessageAndGoback("失败！");
            }
        }
    }
}